import React from "react"
import { Button } from "antd"
import { DownloadOutlined } from "@ant-design/icons"
import styles from "./index.module.scss"

export default function PdfContainer(props) {
  return (
    <div className={styles.root}>
      <iframe src={props.pdfFilePath} title="pdf container" width="100%" height="850"></iframe>

      <div className={styles.action}>
        <Button type="primary" className={styles.btn} href={props.pdfFilePath} target="_blank">
          新窗口打开PDF
        </Button>
        <Button type="primary" icon={<DownloadOutlined />} download={props.pdfFilePath} href={props.pdfFilePath}>
          PDF下载
        </Button>
      </div>
    </div>
  )
}
